<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>个人主页</title>
    <link rel="stylesheet" href="../layui/css/layui.css" type="text/css">

</head>
<style>
    .layui-layer-dialog .layui-layer-content{
        color: black;
    }
</style>
<body style="background-color: #1E9FFF !important;">
<div class="layui-layout layui-layout-admin">

    <div class="layui-header layui-bg-gray">

        <div class="layui-logo" style="font-size: 20px; color: #393D49; cursor: pointer" onclick="index()">作业查重系统学生端</div>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="/student/personal">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    <span style="color: black" th:text="${current.realname}"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="/student/update">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a id="logout" href="javascript:" style="color: black">注销</a></li>
        </ul>
    </div>

    <div>
        <!-- 内容主体区域 -->
        <div style="width: 80%; margin:20px auto 20px auto">
            <div class="layui-row layui-col-space5 layui-bg-gray">
                <div class="layui-col-md12">
                    <div class="layui-row grid-demo">

                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                            <legend>我的提交</legend>
                        </fieldset>
                        <!-- 列表 -->
                        <div class="layui-col-md12">
                            <table class="layui-table" id="oldWorks" lay-filter="oldWorks"></table>
                        </div>


                    </div>
                </div>
            </div>
        </div>
    </div>

    <div style="position: relative;text-align: center;background-color: #eeeeee">
        <!-- 底部固定区域 -->
        © 2019-2020 alushu.xyz 版权所有 ICP证：<a href="http://www.beian.miit.gov.cn" target="_blank">粤ICP备20009324号</a>
    </div>


</div>

<!-- 模板 -->
<script type="text/html" id="statusTpl" th:inline="none">
    {{#  if(d.status === 0){ }}
    <label name="status" class="layui-form-label" style="text-align: left; padding-left: 0">未查阅</label>
    {{#  } else if(d.status === 1) { }}
    <label name="status" class="layui-form-label" style="text-align: left; padding-left: 0">及格</label>
    {{#  } else if(d.status === 2) { }}
    <label name="status" class="layui-form-label" style="text-align: left; padding-left: 0">已查阅</label>
    {{#  } else { }}
    <label name="status" class="layui-form-label" style="text-align: left; padding-left: 0">未及格</label>
    {{#  } }}
</script>

<!-- 方法 -->
<script src="../webjars/jquery/3.4.1/jquery.js"></script>
<script src="../layui/layui.js" type="text/javascript"></script>
<script th:inline="none">

    $('#logout').click(function () {
        layer.confirm('确定退出系统吗',function () {
            window.location="/logout";
        })
    });

    function index(){
        window.location="/student/index"
    }

    layui.use(['form', 'table','element'], function () {
        var form = layui.form
            ,element = layui.element
            , table = layui.table;

        //layui数据表格
        table.render({
            elem: '#oldWorks'
            , url: '/student/showOldWorks'
            ,limit:15
            ,height:'full-100'
            ,page: {
                layout: ['prev', 'page', 'next', 'skip','count']
                ,groups: 5
                ,theme:'#1E9FFF'
            }
            , cols: [[
                {field: 'name', title: '作业名', sort: true}
                , {field: 'updateTime', title: '最后修改时间', sort: true}
                , {field: 'path', title: '提交路径', sort: true}
                , {field: 'size', title: '大小', sort: true}
                , {field: 'ownerName', title: '教师', sort: true}
                , {field: 'status', title: '状态', sort: true, templet:'#statusTpl'}
            ]]
        });


    });


</script>
</body>
</html>
